import PropTypes from "prop-types";
import { Card, Grid } from 'antd-mobile';

const BarcodeBlk = (props) => {
  return (
    <Card title={props.title}>
      <Grid columns={2} gap={12}>
        <Grid.Item>条码</Grid.Item>
        <Grid.Item style={{overflowWrap: 'break-word'}}>{props.data.barcode}</Grid.Item>
        <Grid.Item>包装编码</Grid.Item>
        <Grid.Item>{props.data.pkgCode}</Grid.Item>
        <Grid.Item>包装单位</Grid.Item>
        <Grid.Item>{props.data.pkgUnit}</Grid.Item>
        <Grid.Item>物料编码</Grid.Item>
        <Grid.Item>{props.data.itemCode}</Grid.Item>
        <Grid.Item>物料名称</Grid.Item>
        <Grid.Item>{props.data.itemName}</Grid.Item>
        <Grid.Item>物料数量</Grid.Item>
        <Grid.Item>{props.data.qty}</Grid.Item>
        <Grid.Item>计量单位</Grid.Item>
        <Grid.Item>{props.data.unit}</Grid.Item>
      </Grid>
    </Card>
  );
};

BarcodeBlk.propTypes = {
  title: PropTypes.string,
  data: PropTypes.object
};

export default BarcodeBlk;